#coding:utf-8
from django.shortcuts import render
from django.http import HttpResponse
# from finance.models import *
# from finance.forms import *
# from django.shortcuts import render_to_response
def add(request):
    a = request.GET['a']
    b = request.GET['b']
    c = int(a)+int(b)
    return HttpResponse(str(c))
def home(request):
     #return HttpResponse(u"欢迎光临 自强学堂!")
    return render(request, 'finance/home.html')
def index(request):
    import MySQLdb
    db = MySQLdb.connect("192.168.1.219","root","lcad2013*","bp_user" )
    cursor = db.cursor()
    cursor.execute("SELECT pid,first_name,names from user")
    results = cursor.fetchall()
    db.close()
    List = results
    return render(request,'finance/index.html',{'List': List})
    # form = Mybook()
    # return render_to_response("1.html",{'form':form})
